<?php 
if(!$_SESSION['leider'] || !$index)
{
    include('404.php');
}
else
{
?>
<center>
<h2>Programma Toevoegen</h2>
<table>
    <tr>
        <td style="width: 100px;">Datum: </td>
        <td>
            <select name="prog_datum_dag">
                <option value="14">14</option>
            </select>
            <select name="prog_datum_maand">
                <option value="11">11</option>
            </select>
            <select name="prog_datum_jaar">
                <option value="2011">2011</option>
            </select>
        </td>
    </tr>
    <tr>
        <td style="width: 100px;">Programma: </td>
        <td><input type="text" name="prog_programma" /></td>
    </tr>
    <tr>
        <td style="width: 100px;">Leiding: </td>
        <td>
            <select name="prog_leiding">
                <?php
                    $ps = new PreparedStatement("SELECT leidingid, CONCAT(voornaam, ' ', IFNULL(tussenvoegsels, ' '), ' ', achternaam) AS naam FROM leiding WHERE leidinggroepid = ? ORDER BY achternaam, voornaam ASC;");
                    $ps->setInt($_SESSION['leider']);
                    $q = $ps->execute();
                    while($row = mysql_fetch_array($q))
                    {
                        echo "<option value='{$row['leidingid']}'>{$row['naam']}</option>";
                    }
                ?>
            </select>
        </td>
    </tr>
</table>


</center>
<?php } ?>
